package com.briup.day11.bean;

import javax.naming.Name;

/**
 * @author ThinkBook
 */
public class Teacher {
    private String name;
    private double salary=2000;

    //无参构造
    public Teacher(){
        System.out.println("Teacher() ...");
        name = "unknown";
    }
    //有参构造
    public Teacher(String name,double salary){
        System.out.println("Teacher(String,double) ...");
        System.out.println("赋值前，salary: " + this.salary);
        this.name = name;
        this.salary = salary;
    }
    public Teacher(String name){
        this(name,0);
    }
    public void show(){
        System.out.println("Teacher[name: " + name + ",salary: " + salary + "]");
    }
}
